package com.sample.base.ui.activity

import androidx.databinding.DataBindingUtil
import androidx.fragment.app.Fragment
import com.loyal.adapter.ViewPager2Adapter
import com.sample.base.R
import com.sample.base.base.BaseActivity
import com.sample.base.databinding.ActivityRecyclerBinding
import com.sample.base.ui.fragment.recyclerview.RecyclerClickFragment
import com.sample.base.ui.fragment.recyclerview.RecyclerListFragment

class RecyclerViewActivity : BaseActivity() {
    ///private val binding by lazy { ActivityRecycleBinding.inflate(layoutInflater) }
    private lateinit var binding: ActivityRecyclerBinding

    override fun setLayoutOrView() {
        binding = DataBindingUtil.setContentView(this, R.layout.activity_recycler)
        //setContentView(binding.root)
        binding.toolbar.toolbar.title = "RecyclerView"
    }

    override fun afterOnCreate() {
        val fragments = ArrayList<Fragment>()
        fragments.add(RecyclerListFragment.newInstance())
        fragments.add(RecyclerClickFragment.newInstance())

        binding.adapter = ViewPager2Adapter(this, fragments)
    }
}